<template>
	<div class="hmcell" @click="ceilFn">
		<div class="left">{{ title }}</div>
		<div class="right">{{ desc }} <span class="iconfont iconjiantou1"></span></div>
	</div>
</template>

<script>
export default {
	props: {
		title: String,
		desc: String,
		to: String,
	},
	methods: {
		ceilFn(e) {
			// 如果父组件传递了 to 属性，就根据 to 属性跳转路由
			if (this.to) {
				this.$router.push({
					path: this.to,
				});
			}
			// 预留给父组件也能添加点击事件
			this.$emit("click", e);
		},
	},
};
</script>
<style lang="less" scoped>
.hmcell {
	font-family: "Roboto Regular", "Roboto";
	display: flex;
	height: 50px;
	justify-content: space-between;
	align-items: center;
	margin: 0 20px;
	padding: 5px 0;
	border-bottom: 2px solid #e4e4e4;
	font-size: 16px;
	color: #222;
	.right {
		color: #949494;
		font-size: 14px;
	}
}
</style>
